User
Defined Languages
User
defined languages allow you to add your own language to Notepad++.
This is a very quick and easy way to do so.
Notepad++
always has the main User Define language available. You can use this
to test your settings and then later on create a new language based
on this. The User Define language gets reset each time you restart
Notepad++, its settings will not be saved. User defined languages are
available from the language menu in the bottom.
To
define one, you need the User Define Dialog, which can be accessed by
selecting or pressing the
button.
The
dialog can float like any regular dialog when open, or be docked in
the main Notepad++ window. Simply click the Dock/Undock button to do
so. If the dialog is undocked (floating) you can control its
transparency. Enable the transparency checkbox and control the amount
using the slider. Note that transparency is only available on Windows
2000 and later.
The
dialog shows a dropdownlist of the currently defined user languages.
Select one to change its parameters, if possible they will be
automatically saved. To create a new user language based on the
current state of the main User Defined language, click the Create
New... button, a dialog will pop up asking for the name. To create a
new User language based on the currently selected language, click
Save As... and enter the new name. If you have selected an user
created language, you can click on the Rename button to enter a new
name if necessary, and the Remove button will delete the language.
If
you want the user language to ignore the case of the text (so it will
be case insensitive when looking for keywords), enable the ignore
case checkbox.
For
user created languages, you can also define what file extensions to
associate with them for language autodetection in the textbox with
the Ext label.
Most
settings have a certain text style associated with them. These work
the same as in the Styler Configurator (see Styler
Configurator for details).
Other
aspects of the language are controlled by the settings divided in
four groups:
Default
style and Folding (Folder & Default tab)
This
tab control the style of the default text (text that has no special
attributes or meaning) and the keywords that control the folding. A
keyword in the Folder Open group will trigger a new Fold group that
can be expanded and collapsed. A keyword in the Folder Close group
will close any opened group.
Keywords
(Keywords Lists tab)
This
tab controls what keywords are registered with the language. You can
define up to four groups of keywords, each with their own style. If
you enable the Prefix option for a group, that means that these
keywords can be prefixes of entire words, and thus will be detected
even if the keyword is directly followed by other text. In that case
the other text will be styled the same as the keyword.
Comments/Numbers
(Comment & Number tab)
This
tab controls the behavior and appearance of comments, and the
appearance of numbers.
You
can define multiple comment symbols that are comment line symbols.
These comments run from the symbol itself to the end of the line. You
can also define comment block symbols. These symbols start commenting
from any comment open symbol, until and comment close symbol is
reached.
If
you enable the Treat keyword as symbol checkbox, the comment symbols
also trigger comments if they are the beginning of a word, much like
prefix keywords.
Numbers
are only recognized if they start a word with characters ranging from
0-9, where only the number symbols are styled as such.
Operators
and Delimiters (Operators tab)
This
tab controls what operator symbols exists and what symbols act as
delimiters. Operator symbols are characters that split two words.
They behave much as whitespace but can be styled differently.
Delimiters
are single characters and usually defined in pairs. Any text between
a pair of delimiters as styled as such. A good example is a string,
which is delimited on both sides with double quotes and drawn in a
different color.